A network interface typically couples a computer system with a network, the network interface comprising on-board circuitry or an attached peripheral card. Functions performed by the network interface include receiving packets from the network and transmitting packets from the computer system out onto the network. When packets are received, the network interface may assert one or more interrupts to indicate receipt of the packets to system components—e.g., an operating system or application programs resident on the computer system—that need the packet data. Similarly, when packets are transmitted from the computer system, the network interface may assert one or more interrupts to indicate transmission of a packet or to signal that a transmit queue is empty and ready to receive additional packets for transmission. Control of the network interface is provided by a network driver resident in a memory of the computer system, and the network driver includes an interrupt service routine (ISR) for processing the interrupts generated by the network interface.
When a packet is to be transmitted, the network driver will provide the network interface with a transmit command, and the transmit command indicates to the network interface that the identified packet is ready for transmission. One type of transmit command is a “packet descriptor” (or simply a “descriptor”). A descriptor identifies a memory location of a packet, and the network driver will assign one or more packet descriptors to each packet that is to be transmitted from the computer system.
Typically, as the network driver receives packets from the computer system's operating system and assigns descriptors thereto, the network driver immediately provides the descriptors to the network interface, regardless of the state of the network interface. The descriptors are sent to the network interface over a bus (e.g., a system bus, a peripheral bus, and the like), and each group of descriptors transmitted over the bus requires a bus transaction. Immediately sending descriptors to the network interface is an inefficient use of the bus, however, as only a relatively small number of descriptors will be transmitted to the network interface during a single bus transaction. Use of these “small” bus transactions will necessitate a large number of such transactions, thereby inhibiting use of burst data transactions and preventing the bus from achieving its maximum throughput.
Immediate transfer of descriptors to the network interface also results in packet latency. Each transmission of new descriptors to the network interface may interrupt or otherwise delay operation of the network interface, as the network interface will not be able to transmit packets while descriptors are being transferred to the network interface. Multiple transfers of a small number of new descriptors to the network interface will repeatedly interrupt operation—e.g., fetching packets identified by descriptors previously transferred to the network interface and transmitting those packets to the network—of the network interface. Such delays in transmitting packets increase packet latency and can result in unutilized bandwidth.
Interrupts generated by the network interface during packet transmission to the network may also cause packet latency. One conventional interrupt is commonly referred to as the “Transmit Complete” interrupt. The Transmit Complete interrupt is asserted each time the network interface completes transmission of a packet or packets. A function of the Transmit Complete interrupt is to initiate resource reclamation, which is carried out by the network driver's ISR or similar function. During resource reclamation, processed descriptors are recovered (there is a finite number of available descriptors) for subsequent use by the network driver. Asserting the Transmit Complete interrupt at completion of each transmit operation, however, leads to the generation of a large number of interrupts for high-speed devices. These interrupts must be processed by the network driver, which increases the overhead (e.g., processing resources) associated with interrupt handling, thereby decreasing processor efficiency and increasing packet latency.
Another conventional interrupt is the “Transmit Queue Empty” interrupt. This interrupt signals to the network driver that the network interface's transmit queue is empty and may receive additional packets for transmission. However, by the time the network driver is able to respond to this interrupt (e.g., by providing additional transmit commands), the network interface has sat idle for a period of time, which is an inefficient use of resources and introduces latencies. Algorithms have been developed to predict when the transmit queue at the network interface would be “almost” out of packets, but these algorithms have proven inaccurate and unable to improve efficiency.